onLaunch: function () {
	let that = this;
	// 登录
	wx.login({
		success: res => {

			// 发送 res.code 到后台换取 openId, sessionKey, unionId
			if (res.code) {
				wx.request({
					url: 'https://api.weixin.qq.com/sns/jscode2session',
					data: {
						js_code: res.code,
						appid: that.globalData.appId,
						secret: that.globalData.appSecret,
						grant_type: "authorization_code"
					},
					success: res2 => {
						//设置全局变量的 openid  和 session_key ..
						that.globalData.openId = res2.data.openid;
						that.globalData.sessionKey = res2.data.session_key;
					}

				})
			}
		})

	}
